<?php

require_once 'connect.php';

class keywords extends db {

    public $table_name;
    public $query;

    public function select($page = null) {
        $rows = array();
        $begin = ($page - 1) * PAGE;
        $query = "SELECT * FROM $this->table_name limit " . $begin . "," . PAGE;
        var_dump($query);
        $result = mysql_query($query);
        while ($row = mysql_fetch_assoc($result))
            $rows[] = $row;
        return $rows;
    }
    public function insert($keywords) {
        $query = "INSERT $this->table_name (id, name) values($words[0])";
    }

    public function countWords() {
        $rows = array();
        $query = "SELECT * FROM $this->table_name";
        $result = mysql_query($query);
        while ($row = mysql_fetch_assoc($result))
            $rows[] = $row;
        return count($rows);
    }

}